package com.com.effectivejava.generics.examples;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.logging.Logger;

/**
 * Created by pankaj on 7/19/14.
 */
public class AddT2 {
    static Logger logger = Logger.getLogger(AddT2.class.getName());

    static {
        logger.setParent(Logger.getLogger(AddT2.class.getPackage().getName()));
    }

    static void print(Collection<?> collection){
        for(Object o: collection){
            logger.info(""+o);
        }
    }

    static <T> void add (Collection<?> container, T t){
        //container.add(t);
        container.add(null);
        container.add(null);
        //container.add(new Object());
    }


    public static void main(String[] args) {
        List<String> s = new ArrayList<String>(){{
            add("A");
            add("B");
        }};
        add(s,"C");
        print(s);
    }
}
